<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>委外催收流程跟踪</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<div class="Wrapper">
    <div class="searchArea">
        <div class="fieldBox" style="display:none;">
            <input name="cltAuthId" id="cltAuthId" type="text" class="ui-textbox" value="${cltAuthId}">
        </div>
    </div>
    <div id="ligergrid1" class="sq-grid"></div>
</div>

<script type="text/javascript">
    var basePath = '<%=path%>';
    var grid = null;
    $(function () {
        grid = $("#ligergrid1").ligerGrid({
            url: basePath + '/clt/auth/flow/initFlowTraceList.do?cltAuthId=${cltAuthId}',
            method: 'get',
            columns: [
                {display: '业务数据编号', name: 'grpFlag', minwidth: 120, enabledSort: true},
                {
                    display: '流程名称', name: 'pno', minWidth: 180, align: 'center', enabledSort: true,
                    render: function (rowdata, rowindex, value, column) {
                        return '<a href="javascript:commShowFlow(' + rowindex + ')">' + value + '</a>';
                    }
                },
                {
                    display: '状态', name: 'audStsCd', minwidth: 120, enabledSort: true,
                    render: function (rowdata, rowindex, value) {
                        var h = '';
                        if (value == "0") {
                            h = '待提交';
                        } else if (value == "1") {
                            h = '审核中';
                        } else if (value == "2") {
                            h = '审核通过';
                        } else if (value == "3") {
                            h = '审核不通过';
                        }
                        return h;
                    }
                },
                {display: '创建人', name: 'crtUsrName', minwidth: 120, enabledSort: true},
                {display: '创建时间', name: 'pCrtTm', minWidth: 140, enabledSort: false, render: renderDate},
            ],
            usePager: false,
            root: 'rows',
            record: 'total',
            hideLoadButton: true,
            width: '100%',
            height: '100%',
            heightDiff: -2,
            checkbox: false,
            rownumbers: true,
            onAfterShowData: function () {
                $('#ligergrid1').rowspan('grpFlag');
            }
        });
        grid = liger.get("ligergrid1");
        grid.setHeight(100);

        $("#pageloading").hide();

    });

    function commShowFlow(rowindex) {
        var rowdata = grid.getRow(rowindex);
        var formUrl = "/clt/auth/flow/toCltAuthFlowPage.do?applyId=";
        var params = "?pInsId=" + rowdata.pinstId + "&status=" + rowdata.audStsCd + "&businessKey=" + rowdata.dataId + "&formUrl=" + formUrl;
        Add_navTab('tab_clt001_look_flow_' + rowdata.pinstId, rowdata.pno, basePath + "/flow/flow/toFlowShowPageFowBus.do" + params);
    }

    //格式化时间
    function renderDate(rowdata, index, value) {
        var dateStr = "";
        if (null != value) {
            var date = new Date(value);
            dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DDHHMMSS);
        }
        return dateStr;
    }

</script>

</body>
</html>